<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Mo.js - 简洁高效，容易扩展 - JavaScript Library</title>
<script src="lib/mo.js" type="text/javascript" charset="utf-8"></script>
<script src="res/static.js" type="text/javascript" charset="utf-8"></script>
<link href="res/layout.css" media="screen" rel="stylesheet" type="text/css" />
</head>
<body>

    <div id="wrapper">

        <h1 id="mo-js"> Mo<span>.js</span> </h1>
        <h4 id="build"> Mo.js - 高效 JavaScript 函数库 </h4>
        
        <div id="search">
            <form action="search.html" method="get">
                <input type="text" name="q" value="搜索..." />
            </form>
        </div>

        <div id="naver">
            <ul>
                <li><a href="index.html">Home</a></li>
                <li><a href="browser.html">Browser</a></li>
                <li><a href="selector.html">Selector</a></li>
                <!--li><a href="ajax.html">Ajax</a></li-->
                <!--li><a href="drag.html">Drag</a></li-->
                <li><a href="event.html">Event</a></li>
                <li><a href="date.html">Date</a></li>
                <li><a href="string.html">String</a></li>
                <!--li><a href="number.html">Number</a></li-->
                <li><a href="array.html">Array</a></li>
                <li><a href="cookie.html">Cookie</a></li>
                <li><a href="validate.html">Validate</a></li>
                <!--li><a href="hash.html">Hash</a></li-->
                <li><a href="method.html">Method</a></li>
                <li><a href="toolkit.html">Toolkit</a></li>
                <li><a href="api.html">API</a></li>
            </ul>
        </div>


        <dl id="entry">

            <dt> Mo.Event( event ) </dt>
            <dd>				

                <p>执行交互事件（event）处理操作。</p>

                <blockquote>
                    <p> <strong>event</strong>  event 对象</p>
                </blockquote>
                
            </dd>

            <dt> .stop() </dt>
            <dd>

                <p>停止事件冒泡和浏览器默认行为。</p>
                
                <pre>Mo.Event( event ).stop();</pre>	

                <p id="box">
                    
                    <button>正常冒泡</button>
                    <button id="stop">停止冒泡</button>
                    
                    <strong id="msg"></strong>
                </p>
                
                <script type="text/javascript">
                Mo( "#box" ).bind( 'click' ,function( index ,event ){ 
                    Mo("#msg").html( Mo.random(10) ); 
                });

                Mo( "#stop" ).bind( 'click' ,function( index ,event ){ 
                    Mo.Event( event ).stop();
                });
                </script>	

            </dd>

            <dt> .mouse() </dt>
            <dd>

                <p>获取当前鼠标光标所在位置。</p>
                
                <pre>Mo.Event( event ).mouse();</pre>

                <p id="mouse">
                
                <script type="text/javascript">
                Mo( document ).bind( 'mousemove' ,function( ele, index ,event ){ 
                    var pos = Mo.Event( event ).mouse();
                    Mo("#mouse").html( "X: "+ pos.x + " Y: "+ pos.y ); 
                });
                </script>
                
                </p>

            </dd>

            <dt> .element() </dt>
            <dd>

                <p>获取发生事件的节点对象。</p>
                
                <pre>Mo.Event( event ).element();</pre>

                <p>                    	
                    <button id="btn_element">测试</button> 
                    <strong id="element"></strong>
                </p>
                
                <script type="text/javascript">
                Mo( "#btn_element" ).bind( 'click' ,function( index ,event ){ 
                    Mo("#element").html( Mo.Event( event ).element().tagName ); 
                });
                </script>

            </dd>

            <dt> .target() </dt>
            <dd>

                <p>发生当前在处理的事件的节点。</p>
                
                <pre>Mo.Event( event ).target();</pre>

                <p>                    	
                    <button id="btn_target">测试</button> 
                    <strong id="target"></strong>
                </p>
                
                <script type="text/javascript">
                Mo( "#btn_target" ).bind( 'click' ,function( index ,event ){ 
                    Mo("#target").html( Mo.Event( event ).target().tagName ); 
                });
                </script>

            </dd>

            <dt> .keyboard( code, func ) </dt>
            <dd>

                <p>响应键盘事件。</p>
                
                <pre>Mo.Event( event ).keyboard();</pre>

                <blockquote>
                    <p> <strong>code</strong> keyCode 键盘码，-1 为响应全部按键</p>
                    <p> <strong>func</strong> 回调函数</p>
                </blockquote>

                <p>func 可接受参数</p>
                
                <blockquote>
                    <p> <strong>event</strong> 当前 Event 事件</p>
                    <p> <strong>code</strong> 当前按键码</p>
                </blockquote>
                
                <p>                    	
                    <input id="btn_keyboard" value="" /> 
                    <strong id="keyboard"></strong>
                </p>
                
                <script type="text/javascript">
                Mo( "#btn_keyboard" ).bind( 'keydown' ,function( ele, index ,event ){
                
			Mo.Event( event ).keyboard( -1, function( e, code ){ Mo("#keyboard").html( "按键码："+code ); } );
                    
                });
                </script>

            </dd>

        </dl>

    </div>

    <div id="footer">

        Copyright &copy; 2011 <a href="http://www.veryide.com">VeryIDE</a> <span>|</span><a href="http://www.veryide.com/projects/">Projects</a> <span>|</span> <a href="http://www.veryide.com/projects/mojs/">Mo.js</a> <span>|</span> <a href="packer.html">Packer</a> <span>|</span> <a href="regex.html">Regex</a>

    </div>
            
    <p style="display:none;">
        <script language="javascript" type="text/javascript" src="http://js.users.51.la/960393.js"></script>
    </p>
            
</body>
</html>